package com.bing.jh.entity.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.bing.config.WorkStatusConverter;
import lombok.Data;

import java.io.Serializable;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;

@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
@Data
@ExcelIgnoreUnannotated
public class DzWzCostDtlVO implements Serializable {
    private static final long serialVersionUID = 4577721428212708306L;
    /**
     * 月份
     */
    @ExcelProperty(value = {"个人信息", "月份"})
    private String dataMonth;

    /**
     * 省份编码
     */
    @ExcelProperty(value = {"个人信息", "省份名称"})
    private String provinceCode;

    /**
     * 地市编码
     */
    @ExcelProperty(value = {"个人信息", "地市名称"})
    private String cityCode;

    /**
     * 区县
     */
    @ExcelProperty(value = {"个人信息", "区县名称"})
    private String regionCode;

    /**
     * 全国统一账号
     */
    @ExcelProperty(value = {"个人信息", "全国统一账号"})
    private String account;

    /**
     * 姓名
     */
    @ExcelProperty(value = {"个人信息", "姓名"})
    private String name;

    /**
     * 归属网格名称
     */
    @ExcelProperty(value = {"个人信息", "归属网格名称"})
    private String gridName;

    /**
     * 归属网格编码
     */
    @ExcelProperty(value = {"个人信息", "归属网格编码"})
    private String gridCode;

    /**
     * 代维单位
     */
    @ExcelProperty(value = {"个人信息","代维单位"})
    private String company;

    /**
     * 入职时间
     */
    @ExcelProperty(value = {"个人信息", "入职时间"})
    private String entryTime;


    @ExcelProperty(value = {"个人信息", "工作年限"})
    private Double workMonth;

    /**
     * 工作状态
     */
    @ExcelProperty(value = {"个人信息","工作状态"}, converter = WorkStatusConverter.class)
    private Integer workStatus;

    /**
     * 随销业务量
     */
    @ExcelProperty(value = {"成本指标", "随销业务量"})
    private Integer supportNum;

    /**
     * 随销激励
     */
    @ExcelProperty(value = {"成本指标", "随销激励金"})
    private Integer supportIncentive;

    /**
     * 装维成本
     */
    @ExcelProperty(value = {"成本指标", "装维成本"})
    private Integer installMaintenanceCost;

    /**
     * 计件成本
     */
    @ExcelProperty(value = {"成本指标", "计件成本"})
    private Integer pieceworkCost;

    /**
     * 维护成本
     */
    @ExcelProperty(value = {"成本指标", "维护成本"})
    private Integer maintenanceCost;

    /**
     * 奖惩成本
     */
    @ExcelProperty(value = {"成本指标", "奖惩成本"})
    private Integer rewardPenaltyCost;

    /**
     * 社保成本
     */
    @ExcelProperty(value = {"成本指标", "社保成本"})
    private Integer socialSecurityCost;

    /**
     * 画像综合得分
     */
    @ExcelProperty(value = {"画像得分","画像综合得分"})
    private Double portraitScore;

    /**
     * 基本能力维度得分
     */
    @ExcelProperty(value = {"画像得分","基本能力得分"})
    @NumberFormat("0.00")
    private Double basicAbilityScore;

    /**
     * 服务及时性维度得分
     */
    @ExcelProperty(value = {"画像得分","服务及时性维度得分"})
    private Double serviceOntimeScore;

    /**
     * 服务规范性维度得分
     */
    @ExcelProperty(value = {"画像得分","服务规范性维度得分"})
    private Double serviceStandardScore;

    /**
     * 维护质量维度得分
     */
    @ExcelProperty(value = {"画像得分","维护质量维度得分"})
    private Double maintainQualityScore;

    /**
     * 服务满意度维度得分
     */
    @ExcelProperty(value = {"画像得分","服务满意度维度得分"})
    private Double serviceSatisfactionScore;

    /**
     * 随销支撑维度得分
     */
    @ExcelProperty(value = {"画像得分","随销支撑维度得分"})
    private Double supportDimensionScore;

    /**
     * 随销业务量省内排行
     */
    @ExcelProperty(value = {"省内排行", "随销业务量省内排行"})
    private Integer salesVolumeProvRank;


    /**
     * 画像综合得分等级
     */
    @ExcelProperty(value = {"个人信息", "随销业务量星级"})
    private Integer salesVolumeGrade;

    /**
     * 画像综合得分省内排行
     */
    @ExcelProperty(value = {"省内排行", "画像综合得分省内排行"})
    private Integer portraitScoreProvRank;


    /**
     * 画像综合得分等级
     */
    @ExcelProperty(value = {"个人信息", "画像综合得分星级"})
    private Integer portraitScoreGrade;

    /**
     * 维护小区数
     */
    @ExcelProperty(value = {"其他指标", "维护小区数"})
    private Integer communities;

    /**
     * 维护家宽用户数
     */
    @ExcelProperty(value = {"其他指标", "维护家宽用户数"})
    private Integer homeWideNum;

}

class DzWzUserGroupVO {
    private String areaType;

    public DzWzUserGroupVO(String areaType) {
        this.areaType = areaType;
    }

    public String getAreaType() {
        return areaType;
    }

    public void setAreaType(String areaType) {
        this.areaType = areaType;
    }
}

class Main {
    public static void main(String[] args) {
        // 模拟数据
        List<DzWzUserGroupVO> tZwArchives = new ArrayList<>(Arrays.asList(
                new DzWzUserGroupVO("北京"),
                new DzWzUserGroupVO("安徽"),
                new DzWzUserGroupVO("福建"),
                new DzWzUserGroupVO("上海"),
                new DzWzUserGroupVO("浙江")
        ));

        // 获取中国本地化顺序的 Collator 对象
        Locale locale = Locale.CHINA;
        Collator collator = Collator.getInstance(locale);

        // 使用流根据拼音排序
        List<DzWzUserGroupVO> sortedList = tZwArchives.stream()
                .sorted((o1, o2) -> collator.compare(o1.getAreaType(), o2.getAreaType()))
                .collect(Collectors.toList());

        // 打印排序结果
        sortedList.forEach(statVO -> System.out.println(statVO.getAreaType()));
    }
}
